Skip to content

refactor: group response tags, use let-else in proto handlers - #129

Merged
kacy merged 1 commit into
mainfrom
refactor/server-response-grouping
Feb 14, 2026
Merged

refactor: group response tags, use let-else in proto handlers#129
kacy merged 1 commit into
mainfrom
refactor/server-response-grouping

Conversation

@kacy

@kacy kacy commented Feb 14, 2026

Copy link
Copy Markdown
Owner

summary

  • connection.rs: merged identical ResponseTag arms in resolve_shard_response using | patterns. tags with the same response shape (e.g. Get/PopResult/HGetResult all extract Value→Bulk) now share a single match arm
  • concurrent_handler.rs: replaced verbose match engine.schema_registry() { Some(r) => r, None => return ... } patterns with idiomatic let-else across all 5 registry accesses and 4 RwLock read/write guards

what was tested

  • cargo build -p ember-server --features grpc,vector,protobuf — clean build
  • cargo test -p ember-server --features grpc,vector,protobuf — all 43 tests pass

connection.rs:
- merged identical ResponseTag arms with `|` patterns:
  Get | PopResult | HGetResult (all: Value → Bulk/Null + WrongType)
  HExistsResult | SIsMemberResult (both: Bool → Integer + WrongType)
  LenResultOom | HSetResult (both: Len → Integer + WrongType + OOM)
  ArrayResult | HValsResult (both: Array → Array of Bulk + WrongType)
- added section comments for vector and protobuf response groups

concurrent_handler.rs:
- replaced match-on-Option/Result patterns with let-else for schema
  registry access (5 match→let Some, 4 match→let Ok)
@kacy
kacy merged commit 7f26ce4 into main Feb 14, 2026
5 of 7 checks passed
@kacy
kacy deleted the refactor/server-response-grouping branch February 14, 2026 22:23
kacy added a commit that referenced this pull request Feb 19, 2026
connection.rs:
- merged identical ResponseTag arms with `|` patterns:
  Get | PopResult | HGetResult (all: Value → Bulk/Null + WrongType)
  HExistsResult | SIsMemberResult (both: Bool → Integer + WrongType)
  LenResultOom | HSetResult (both: Len → Integer + WrongType + OOM)
  ArrayResult | HValsResult (both: Array → Array of Bulk + WrongType)
- added section comments for vector and protobuf response groups

concurrent_handler.rs:
- replaced match-on-Option/Result patterns with let-else for schema
  registry access (5 match→let Some, 4 match→let Ok)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant